<%@ page import="java.util.List" %>
<%@ page import="model.Student" %><%--
  Created by IntelliJ IDEA.
  User: 张棋
  Date: 2024/8/1
  Time: 10:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    List<Student> stulist = (List<Student>) request.getAttribute("stulist");
%>
<h1>学生信息展示</h1>>
<table cellpadding ='3' cellspacing='0' border='1' align='center'>
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>专业</th>
        <th>时间</th>
        <th>操作1</th>
        <th>操作2</th>
    </tr>
    <%
        for (int i = 0; i < stulist.size(); i++) {
    %>
    <tr>
        <td><%=stulist.get(i).getId()%></td>
        <td><%=stulist.get(i).getName()%></td>
        <td><%=stulist.get(i).getSex()%></td>
        <td><%=stulist.get(i).getAge()%></td>
        <td><%=stulist.get(i).getMajor()%></td>
        <td><%=stulist.get(i).getTime()%></td>
        <td onclick="if(confirm('确认删除吗？')){window.location.href='DelUser?id=<%=stulist.get(i).getId()%>'}else{return false;}">删除</td>
        <td onclick="if(confirm('确认更新吗？')){window.location.href='update?id=<%=stulist.get(i).getId()%>'}else{return false;}">更新</td>
    </tr>
    <%
        }
    %>

</table>
</body>
</html>
